package com.example.mapper;

import com.example.bean.Statement;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StatementMapper {

    @Select("SELECT userId,money,content,statementId FROM statement")
    public List<Statement> selectProfit(); // 查看办卡盈利的金额

    @Insert("INSERT INTO statement(userId,money,content) VALUE(#{userId},#{money},#{content})")
    public int insert(Statement statement);
    @Select("SELECT userId,money,content,statementId FROM statement WHERE content IN ('逾期还书', '书本丢失', '书籍损坏')")
    public List<Statement> selectFine();   // 查看罚款所受金额

    /*@Select("SELECT SUM(money) AS moneySum FROM statement")
    public Statement selectSumMoney();  // 显示所有金额之和*/
}
